#!/usr/bin/env python
# vim:fileencoding=utf-8

from calibre.web.feeds.news import BasicNewsRecipe


class Project(BasicNewsRecipe):
    title = '\u041F\u0440\u043E\u0435\u043A\u0442'
    __author__ = 'bugmen00t'
    description = '\u0418\u043D\u0442\u0435\u0440\u043D\u0435\u0442-\u0438\u0437\u0434\u0430\u043D\u0438\u0435, \u0441\u043E\u0437\u0434\u0430\u043D\u043D\u043E\u0435 \u0431\u044B\u0432\u0448\u0438\u043C \u0433\u043B\u0430\u0432\u043D\u044B\u043C \u0440\u0435\u0434\u0430\u043A\u0442\u043E\u0440\u043E\u043C \u0442\u0435\u043B\u0435\u043A\u0430\u043D\u0430\u043B\u0430 \u00AB\u0414\u043E\u0436\u0434\u044C\u00BB \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0421\u041C\u0418 \u0420\u043E\u043C\u0430\u043D\u043E\u043C \u0411\u0430\u0434\u0430\u043D\u0438\u043D\u044B\u043C, \u043A\u043E\u0442\u043E\u0440\u0435 \u0441\u043F\u0435\u0446\u0438\u0430\u043B\u0438\u0437\u0438\u0440\u0443\u044E\u0435\u0442\u0441\u044F \u043D\u0430 \u0440\u0430\u0441\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u043E\u0439 \u0436\u0443\u0440\u043D\u0430\u043B\u0438\u0441\u0442\u0438\u043A\u0435.'  # noqa
    publisher = '\u0420\u043E\u043C\u0430\u043D \u0411\u0430\u0434\u0430\u043D\u0438\u043D'
    category = 'blog'
    cover_url = u'https://proektmedia-stat.ams3.digitaloceanspaces.com/2018/08/proektmedia_facebook_default.png'
    language = 'ru'
    no_stylesheets = False
    remove_javascript = False
    auto_cleanup = False
    oldest_article = 200
    max_articles_per_feed = 20

    remove_tags_before = dict(name='main')

    remove_tags_after = dict(
        name='div', attrs={'class': 'single-post__article js-post-article'}
    )

    remove_tags = [
        dict(name='span', attrs={'class': 'more'}),
        dict(name='span', attrs={'class': 'close'}),
        dict(name='div', attrs={'class': 'socials js-socials-icons'})
    ]

    feeds = [
        ('\u041F\u0440\u043E\u0435\u043A\u0442.', 'https://www.proekt.media/feed/')
    ]

    def get_browser(self):
        br = BasicNewsRecipe.get_browser(self, user_agent='common_words/based')
        return br
